package com.wangsiyu.zookeeper.rmi.server;

import com.wangsiyu.zookeeper.rmi.common.HelloService;

import java.rmi.RemoteException;

public class Server {
    public static void main(String[] args) throws Exception {
        System.out.println("server 11215 start");
        //当前rmi服务器的ip，port
        String host = "192.168.25.1";
        int port = Integer.parseInt("11215");
        //创建服务的生产者对象
        ServiceProvider provider = new ServiceProvider();
        //创建实现类的对象
        HelloService helloService = new HelloServiceImpl();
        //发布rmi服务
        provider.publish(helloService, host, port);
        Thread.sleep(Long.MAX_VALUE);
    }
}
